package com.tboss.template.system.dao;

import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;

import com.tboss.global.helpers.sqlSession.SqlSessionSupport;
import com.tboss.template.system.dto.CodeDto;

@Repository
public class CodeDao extends SqlSessionSupport {
	
	@Autowired
	public CodeDao(@Qualifier("sqlSession") SqlSession sqlSession){
		super(sqlSession);
	}

	@Override
	public String getNameSpace() {
		return "code";
	}
	
	public Integer getCodeListCnt(CodeDto codeDto){
		return super.queryForObject("getCodeListCnt", codeDto);
	}
	
	public List<CodeDto> getCodeList(CodeDto codeDto){
		return super.queryForList("getCodeList", codeDto);
	}
	
	public CodeDto getCodeInfo(String cdId){
		return super.queryForObject("getCodeInfo", cdId);
	}

	public List<CodeDto> getAvailableCodeList(CodeDto codeDto){
		return super.queryForList("getAvailableCodeList", codeDto);
	}	
	
	public Integer existCodeId(String cdId){
		return super.queryForObject("existCodeId", cdId);
	}
	
	public Integer existCodeAlias(CodeDto dto){
		return super.queryForObject("existCodeAlias", dto);
	}
	
	public void addCodeInfo(CodeDto dto){
		super.queryForObject("addCodeInfo", dto);
	}
	
	public void updateCodeInfo(CodeDto dto){
		super.queryForObject("updateCodeInfo", dto);
	}
	
}
